'\" te
.\"  Copyright (c) 1998 Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH TD_THR_SETSIGPENDING 3C_DB "September 12, 2020"
.SH NAME
td_thr_setsigpending, td_thr_sigsetmask \- manage thread signals for libc_db
.SH SYNOPSIS
.nf
cc [ \fIflag\fR... ] \fIfile\fR... -lc_db [ \fIlibrary\fR... ]
#include <proc_service.h>
#include <thread_db.h>

\fBtd_err_e\fR \fBtd_thr_setsigpending\fR(\fBconst td_thrhandle_t *\fR \fIth_p\fR, \fBconst uchar_t\fR \fIti_sigpending_flag\fR,
     \fBconst sigset_t\fR \fIti_sigmask\fR);
.fi

.LP
.nf
\fBtd_err_e\fR \fBtd_thr_sigsetmask\fR(\fBconst td_thrhandle_t *\fR\fIth_p\fR, \fBconst sigset_t\fR \fIti_sigmask\fR);
.fi

.SH DESCRIPTION
The \fBtd_thr_setsigpending()\fR and \fBtd_thr_setsigmask()\fR functions affect
the signal state of the thread identified by \fIth_p\fR.
.sp
.LP
The \fBtd_thr_setsigpending()\fR function sets the set of pending signals for
thread \fIth_p\fR to \fIti_sigpending\fR. The value of the \fBlibc\fR-internal
field that indicates whether a thread has any signal pending is set to
\fIti_sigpending_flag\fR. To be consistent, \fIti_sigpending_flag\fR should be
0 if and only if all of the bits in \fIti_sigpending\fR are 0.
.sp
.LP
The \fBtd_thr_sigsetmask()\fR function sets the signal mask of the thread
\fIth_p\fR as if the thread had set its own signal mask with
\fBthr_sigsetmask\fR(3C). The new signal mask is the value of
\fBti_sigmask\fR.
.sp
.LP
There is no equivalent to the \fBSIG_BLOCK\fR or \fBSIG_UNBLOCK\fR operations
of \fBthr_sigsetmask\fR(3C), which mask or unmask specific signals without
affecting the mask state of other signals. To block or unblock specific
signals,
.RS +4
.TP
1.
stop either the entire process or the thread with \fBtd_thr_dbsuspend()\fR,
.RE
.RS +4
.TP
2.
determine the thread's existing signal mask by calling
.BR td_thr_get_info (3C_DB),
.RE
.RS +4
.TP
3.
modify the \fIti_sigmask\fR member of the \fBtd_thrinfo_t\fR structure as
desired, and
.RE
.RS +4
.TP
4.
set the new signal mask with \fBtd_thr_sigsetmask()\fR.
.RE
.SH RETURN VALUES
.ne 2
.na
\fB\fBTD_OK\fR\fR
.ad
.RS 12n
The call completed successfully.
.RE

.sp
.ne 2
.na
\fB\fBTD_BADTH\fR\fR
.ad
.RS 12n
An invalid thread handle was passed in.
.RE

.sp
.ne 2
.na
\fB\fBTD_DBERR\fR\fR
.ad
.RS 12n
A call to one of the imported interface routines failed.
.RE

.sp
.ne 2
.na
\fB\fBTD_ERR\fR\fR
.ad
.RS 12n
A \fBlibc_db\fR internal error occurred.
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
MT-Level	Safe
.TE

.SH SEE ALSO
\fBlibc_db\fR(3LIB), \fBtd_thr_dbsuspend\fR(3C_DB),
\fBtd_thr_get_info\fR(3C_DB), \fBattributes\fR(7)
